package persist.sqlapp;

import static com.sleepycat.persist.model.Relationship.MANY_TO_ONE;

import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.SecondaryKey;

@Entity
public class RediusLog {
	@PrimaryKey
	int ip;

	@SecondaryKey(relate = MANY_TO_ONE)
	private int online;

	@SecondaryKey(relate = MANY_TO_ONE)
	private int offline;
	
	@SecondaryKey(relate = MANY_TO_ONE)
	private String id;

	public RediusLog() { }
	
	public RediusLog(int ip, int online, int offline, String id) {
		this.ip = ip;
		this.online = online;
		this.offline = offline;
		this.id = id;
	}

	public int getOnline() {
		return online;
	}

	public void setOnline(int online) {
		this.online = online;
	}

	public int getOffline() {
		return offline;
	}

	public void setOffline(int offline) {
		this.offline = offline;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "ip=" + ip + ",online=" + online + "offline=" + offline + "id=" + id;
	}

}
